import os
import time


class TextGenerator:

    def generate(self, file_name, num_lines, content):
        if os.path.exists(file_name):
            print(f'{file_name} already exists, will not overwrite.')
            return

        start_time = time.time()

        with open(file_name, 'w') as f:
            for i in range(num_lines):
                f.write(content + '\n')

        end_time = time.time()
        print(f'Generated {num_lines} lines in {end_time - start_time:.2f}s')
